﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Genesis.Installer.Extensions.Forms
{
    public partial class UserInput : Form
    {
        protected System.Collections.Specialized.HybridDictionary settings;

        public UserInput()
        {
            InitializeComponent();
            settings = new System.Collections.Specialized.HybridDictionary();
        }

        public void LoadUserInputControl(Controls.Base UserInputControl)
        {
            if (panelContainer.Controls.Count != 0)
            {
                Forms.Controls.Base control = (Forms.Controls.Base)panelContainer.Controls[0];

                foreach (System.Collections.DictionaryEntry setting in control.settings)
                {
                    settings.Add(setting.Key, setting.Value);
                }

                panelContainer.Controls.Clear();
            }

            panelContainer.Controls.Add(UserInputControl);

            UserInputControl.SetDefaultFocus();

            this.Update();
        }

        public System.Collections.Specialized.HybridDictionary Settings
        {
            get
            {
                return settings;
            }
        }
    }
}
